﻿#ifndef __AF_CANVAS_H__
#define __AF_CANVAS_H__

#include "AF_Define.h"

namespace AF
{
	class Canvas;
}
typedef AF::Canvas		AF_CCanvas;

#include "AF_Graphics.h"
#include "AF_Image.h"
#include "AF_Effect.h"

namespace AF
{
	/// 画布类
	class _ABSTRACT Canvas
	{
	public:
		Canvas();
		virtual ~Canvas();

	public:
		/// 初始化画布
		bool			Init(WindowHandle pWndHandle);
		/// 激活画布
		bool			Enabled();
		/// 废除画布
		void			Disabled();
		/// 绘制画布
		bool			Render();

	protected:
		virtual bool		OnInit(WindowHandle pWndHandle) = 0;

		virtual bool		OnEnabled()
					{return true;}
		virtual void		OnDisabled()
					{return;}
		virtual bool		OnRender() = 0;

	public:
		/// 添加可绘制对象
		virtual void		AddGraphics(Graphics* pGraphics) = 0;
// 		/// 变更可绘制对象
// 		virtual void		ChangeGraphics(AF_CGraphics* pGraphics);
		/// 移除可绘制对象
		virtual void		RemoveGraphics(Graphics* pGraphics) = 0;
		/// 调整可绘制对象
		virtual void		MoveGraphics(Graphics* pGraphics, UINT nIndex) = 0;
		/// 清除可绘制对象
		virtual void		CleanGarphicses() = 0;

	protected:
		bool			m_isEnabled;
	};
}

#endif